<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script>
    document.addEventListener('DOMContentLoaded', function() {
    const markdownContent = fetch('/doc{{ path }}.md')
    .then(response => {
        if (!response.ok) {
            throw new Error('无法加载markdown文件');
        }
        return response.text();
    })
    .then(text => {
        document.getElementById('markdown-container').innerHTML = marked.parse(text);
    })
    .catch(error => {
        console.error('加载markdown文件时出错:', error);
        document.getElementById('markdown-container').innerHTML = marked.parse('# 加载内容失败\n请稍后再试');
    });
});
</script>